<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area" @click="showMap=true">
			<text class="title">{{title}}</text>
		</view>
		<view style="margin-top: 100rpx;">{{prov}}{{city}}{{address}}</view>

		<view v-if="showMap">
			<selectLoc :showMap="showMap" @close="closeLoc" @confirm="confirmLoc"></selectLoc>
		</view>
	</view>
</template>

<script>
	import selectLoc from "../../../components/selectLoc/selectLoc.vue"
	export default {
		components: {
			selectLoc
		},
		data() {
			return {
				title: '选择打卡地址',
				showMap: false,
				lat: '',
				lng: '',
				prov: '',
				city: '',
				area: '',
				address: ''
			}
		},
		onLoad() {

		},
		methods: {
			confirmLoc(res) {
				this.showMap = false;
				this.lat = res.lat;
				this.lng = res.lng;
				this.prov = res.province;
				this.city = res.city;
				this.area = res.area;
				this.address = res.district;
				console.log('选择的信息', res);
			},
			closeLoc() {
				this.showMap = false;
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>